package com.kpy.providernacos.controller;

import com.kpy.providernacos.dao.UserRepository;
import com.kpy.providernacos.model.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @auther: kpy
 * @version: 1.0
 * @Package: com.kpy.providernacos.controller
 * @data: 2022-3-22 8:52
 * @discription:
 **/

@RestController
public class ProviderNacosController {

    private UserRepository userRepository;

    public ProviderNacosController(UserRepository userRepository) {
        this.userRepository = userRepository;
    }

    @GetMapping("/{id}")
    public User findById(@PathVariable long id){
        System.out.println("id="+id);
        User user = userRepository.getById(id);
        return user;
    }

}
